package com.zyx.spring5msb.aoptx.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author Yaxi.Zhang
 * @since 2021/9/30 10:45
 */
@Service
public class MultiService {

    @Autowired
    private BookService bookService;

    @Transactional
    public void mulTx(){
        try {
            bookService.checkout("zhangsan",1);
        } catch (Exception exception) {
            exception.printStackTrace();
        }
        bookService.updatePrice(1,1000);
        int i = 1 / 0;
    }
}
